
//
//  FristViewController.m
//  block中的全局变量循环问题
//
//  Created by MyMac on 15/8/3.
//  Copyright (c) 2015年 MyMac. All rights reserved.
//

#import "FristViewController.h"

@interface FristViewController ()
{
    NSString*_name;

}
@property (copy, nonatomic) void(^Callblock)();

@end

@implementation FristViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _name=@"jjjj";
    __weak NSString*tempName=_name;
    self.Callblock=^{
        NSLog(@"%@",tempName);
    };

    // Do any additional setup after loading the view.
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    
    self.Callblock();
    [self dismissViewControllerAnimated:YES completion:nil];
    
}
-(void)dealloc{
    NSLog(@"释放%@",self.class);

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
